V = Variables
R = Reading functions
ASCII —→ UNSIGNED WORD
The VR10AscToUWr function converts an Ascii variable type in an Unsigned Word type (word without sign).
VR10AscToUWr (array, index, return, errcode)
Parameters:
| IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
|---|---|---|---|---|
| IN | ARRGBL | array | B | Array contenente il dato da convertire (deve essere dichiarato con almeno “index+3” elementi) |
| IN | GLOBAL | index | L | Indice dell'elemento array dove inizia il dato |
| OUT | GLOBAL | return | L | Valore del dato convertito |
| OUT | GLOBAL | errcode | F | Variabile che segnala un eventuale errore sulla funzione |
Una volta richiamata la funzione, 'errcode' può assumere determinati valori, il significato di tali valori è riassunto di seguito:
0: Nessun errore
1: Errore: valore ASCII non compreso tra 48÷57 o 65÷70
Trasforma il valore Ascii D832h (55346 DEC) in un valore unsigned word
index = 1 array[1] = 68 array[2] = 56 array[3 = 51 array[4 = 50 VR10AscToUWr (array, index, return, errcode) ;Sul dato return si troverà : ; return = 55346